package com.caine.androidtask.ls11;

/**
 @author : CaineZhu
 @date : 2013-01-15 13:22:46
 @desc  : for command  *#*#935#*#* *#*#66#*#* *#*#38#*#* *#*#945#*#*

 */

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.caine.androidtask.R;


public class Ls11 extends Activity {
private TextView mUserName;
private TextView mUserPassWord;
private Button mRegister;
public static final int RESQUESTCODE = 0X0001;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	   setContentView(R.layout.caine_ls11);
	   init();
	}
	
	void init(){
		mUserName = (TextView) findViewById(R.id.ls11_username);
		mUserPassWord = (TextView) findViewById(R.id.ls11_userpassword);
		mRegister = (Button) findViewById(R.id.ls11_register);
		mRegister.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Ls11.this, Register.class);
				startActivityForResult(intent, RESQUESTCODE);
				//finish();
			}
		});
	}
	
	@Override
		protected void onActivityResult(int requestCode, int resultCode, Intent data) {
			// TODO Auto-generated method stub
			super.onActivityResult(requestCode, resultCode, data);
			System.out.println("requestCode ===>"+requestCode+"  resultCode===>"+resultCode);
			if(resultCode == RESQUESTCODE){
				Bundle bundle = data.getBundleExtra("Ls11_bundle");
				mUserName.setText("userName : "+bundle.getString("username"));
				mUserPassWord.setText("userPassWord : "+bundle.getString("userpassword"));
				System.out.println("bundle.getString(\"username\")"+bundle.getString("username"));
				System.out.println("mUserPassWord.setText(bundle.getString(\"userpassword\"))"+bundle.getString("userpassword"));
			}
		}
}
